<template>
  <div class="hotPush">
    <div class="hotPush_tit">
      热门推荐
    </div>
    <div class="card">
      <hotgoods-card :item="item"  v-for="(item,index) in hotData" :key="index"></hotgoods-card>
    </div>

  </div>
</template>

<script>
//引入组件

import { queryRecommendData } from "@/netWork/api/index.js";
import hotgoodsCard from "./commonality/hotgoodsCard.vue"; //商品卡片

export default {
  components: { hotgoodsCard },
  data() {
    return {
      hotData: [],
    };
  },
  mounted() {
    this.recommendData();
  },
  methods: {
    recommendData() {
      queryRecommendData().then((res) => {
        console.log(res.data.data.list);
        this.hotData = res.data.data.list;
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.hotPush {
  .hotPush_tit {
    margin: 10px;
  }
  .card{
    display: flex;
    flex-wrap: wrap;
    
  }
}
</style>